home *** CD-ROM | disk | FTP | other *** search
- function magic_burst(unit)
- local magic = {}
- local magic_ps = {}
- magic[0] = unit:addSimpleEffect(ENET_EFFECT_DUMMY)
- magic[0]:setLocalPosition(0,20,0)
- magic[0]:addRotationEffect(ENET_EFFECT_ROTATE_RADAR,MATH_PI * 2)
- magic_ps[0] = magic[0]:addSimpleEffect(ENET_EFFECT_PS_EFFECTMORDASHOT1)
- magic_ps[0]:setLocalPosition(20,0,0)
-
- magic[1] = unit:addSimpleEffect(ENET_EFFECT_DUMMY)
- magic[1]:setLocalPosition(0,20,0)
- magic[1]:addRotationEffect(ENET_EFFECT_ROTATE_RADAR,-MATH_PI * 2)
- magic_ps[1] = magic[1]:addSimpleEffect(ENET_EFFECT_PS_EFFECTMORDASHOT1)
- magic_ps[1]:setLocalPosition(20,0,0)
-
- pause(2.8)
- magic_ps[0]:suspend()
- magic_ps[1]:suspend()
- magic[0]:suspendedDestroy(2.0)
- magic[1]:suspendedDestroy(2.0)
- end
-
- -- scripts for unit section
- function units_dot_setup()
- units_setup(4,false,ENET_EFFECT_PS_SETUPSMOKE_SMALL,ENET_EFFECT_GEOMETRY_DOTSHADOW)
- end
-
- function units_dot_resetup()
- units_setup(4,false,nil,ENET_EFFECT_GEOMETRY_DOTSHADOW)
- end
-
- function units_dot_select()
- units_select(12,2)
- end
-
- function units_dot_unselect()
- units_unselect()
- end
-
- function units_dot_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_dot_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_dot_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_dot_explode()
- units_explode_small1()
- end
-
- function units_dot_fire()
- local unit = uniGetExecutor()
- local gt = unit:getBone(ENBT_GUNTOWER)
- local sound = gt:play3DSound("pillbox rotate.wav",1)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- sound:destroy()
- local firespot = gt:getBone(ENBT_FIRE1)
- waitDeath(gt:aimGun(0,MATH_PI / 3.0,uniGetTarget()))
-
- local i = 0
- for i = 0,0 do
- gt:play3DSound("pillbox fire2.wav",0)
- local shot1 = firespot:addSimpleEffect(ENET_EFFECT_DOTSHOT_FLY)
- local shot2 = firespot:addBulletEffect(ENET_EFFECT_PS_DOTSHOT)
- shot1:executeCommand(ENC_FIRE1)
- shot2:suspendedDestroy(1.5)
- gt:gunRecoil(0,0.3,8)
- end
- pause(1.25)
- unit:addFireArrow()
- end
-
- function units_dot_move()
- end
-
- -- register unit section
- registerCommand(ENSCRIPTSET_DOT,ENC_MOVE,"units_dot_move")
- registerCommand(ENSCRIPTSET_DOT,ENC_FIRE1,"units_dot_fire")
- registerCommand(ENSCRIPTSET_DOT,ENC_FIRE2,"units_dot_fire")
- registerCommand(ENSCRIPTSET_DOT,ENC_SELECT,"units_dot_select")
- registerCommand(ENSCRIPTSET_DOT,ENC_SELECTENEMY,"units_dot_selectenemy")
- registerCommand(ENSCRIPTSET_DOT,ENC_UNSELECT,"units_dot_unselect")
- registerCommand(ENSCRIPTSET_DOT,ENC_SETUP,"units_dot_setup")
- registerCommand(ENSCRIPTSET_DOT,ENC_RESETUP,"units_dot_resetup")
- registerCommand(ENSCRIPTSET_DOT,ENC_DAMAGED,"units_dot_damaged")
- registerCommand(ENSCRIPTSET_DOT,ENC_EXPLODE,"units_dot_explode")
- registerCommand(ENSCRIPTSET_DOT,ENC_HIGHLIGHT,"units_dot_highlight")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_DOT)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dot.rmd"
- desc.ScriptSet = ENSCRIPTSET_DOT
- desc.MoveType = ENMOVE_NOTALLOWED
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_DOTSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dot_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- --------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------
- --[[
- -- "breathing" dot
- interpolator = createInterpolator()
- interpolator:addKey(0.0,0.9)
- interpolator:addKey(2.0,1.1)
- interpolator:addKey(4.0,0.9)
- interpolator:finalize(true)
- -- add interpolator on X scale
- desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_SCALE_X))
- -- add interpolator on Y scale
- desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_SCALE_Y))
- -- add interpolator on Z scale
- desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_SCALE_Z))
- changeEffect(ENET_UNIT_DOT,desc)
- ]]--
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(26)
- unitDesc.group = 2
- unitDesc.order = 0
- unitDesc.unit_res_id = ENET_UNIT_DOT
- unitDesc.unit_icon_id = "Dot_h_small_normal.dds"
- unitDesc.active_id = "Dot_h_small_active.dds"
- unitDesc.pressed_id = "Dot_h_small_pressed.dds"
- unitDesc.small_icon_id = "Dot_u_stats.dds"
- unitDesc.big_icon_id = "Dot_h_big_normal.dds"
- unitDesc.HP = 4
- unitDesc.MP = 0
- unitDesc.WR = 2
- unitDesc.min_WR = 1
- unitDesc.WD = 1
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 1
- unitDesc.transport = 0
- unitDesc.value = 1
- unitDesc.race = 0
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "PILLBOX"
-
-
-